package com.yang.service.impl;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.yang.dao.UserDao;
import com.yang.model.Role;
import com.yang.model.User;
import com.yang.service.UserService;

@Service
public class UserServiceImpl implements UserService {

	@Autowired
	private UserDao userDao;
	@Override
	public User doLogin(User user) {
		
		return userDao.selectByUser(user);
	}
	@Override
	public List<User> queryUsers(Map<String, Object> map) {
		return userDao.queryUsers(map);
	}
	@Override
	public List<User> queryAllUsers(Map<String, Object> map) {
		
		return userDao.queryAllUsers(map);
	}
	@Override
	public void addUser(User user) {
		
		userDao.insertUser(user);
	}
	@Override
	public User selectUserByUserId(Integer userId) {
		
		return userDao.queryUserById(userId);
	}
	@Override
	public void updateUser(User user) {
		
		userDao.updateUser(user);	
	}
	@Override
	public void deleteUser(Integer userId) {
		
		userDao.deleteUser(userId);
	}
	@Override
	public void deleteUsers(Integer[] userIds) {
		userDao.deleteUsers(userIds);
	}
	@Override
	public void InsertRoles(Map<String, Object> param) {
		userDao.InsertRoles(param);
	}
	@Override
	public void deleteRoles(Map<String, Object> param) {
		userDao.deleteRoles(param);
	}


}
